package com.androidx.p013lv.invention.adapter;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.VideoBean;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.TimeUtils;
import com.androidx.p013lv.base.utils.UiUtils;
import com.androidx.p013lv.invention.C1069R;
import com.bumptech.glide.Glide;
import java.util.List;

/* renamed from: com.androidx.lv.invention.adapter.AdapterFifteen */
public class AdapterFifteen extends BaseRecyclerAdapter<VideoBean, Holder> {
    String domain;
    Fragment fragment;
    double height;

    public AdapterFifteen(Fragment fragment2, List<VideoBean> list) {
        this.list = list;
        this.fragment = fragment2;
    }

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((VideoBean) this.list.get(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
        ImageView imageView = holder.iv_cover;
        if (imageView != null) {
            Glide.with(imageView.getContext()).clear(imageView);
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1069R.C1074layout.item_invention_fifteen, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.invention.adapter.AdapterFifteen$Holder */
    public class Holder extends BaseRecyclerHolder {
        ImageView iv_cover;
        ImageView iv_original;
        ImageView iv_pay;
        ImageView iv_vip;
        ImageView iv_xm;
        RelativeLayout rl_content;
        TextView tv_name;
        TextView tv_score;
        TextView tv_subtitle;
        TextView tv_time;
        TextView tv_title;

        public Holder(View view) {
            super(view);
            this.iv_cover = (ImageView) view.findViewById(C1069R.C1072id.iv_cover);
            this.iv_pay = (ImageView) view.findViewById(C1069R.C1072id.iv_pay);
            this.iv_vip = (ImageView) view.findViewById(C1069R.C1072id.iv_vip);
            this.iv_xm = (ImageView) view.findViewById(C1069R.C1072id.iv_xm);
            this.iv_original = (ImageView) view.findViewById(C1069R.C1072id.iv_original);
            this.tv_name = (TextView) view.findViewById(C1069R.C1072id.tv_name);
            this.tv_score = (TextView) view.findViewById(C1069R.C1072id.tv_score);
            this.tv_title = (TextView) view.findViewById(C1069R.C1072id.tv_title);
            this.tv_time = (TextView) view.findViewById(C1069R.C1072id.tv_time);
            this.rl_content = (RelativeLayout) view.findViewById(C1069R.C1072id.rl_content);
            this.tv_subtitle = (TextView) view.findViewById(C1069R.C1072id.tv_subtitle);
        }

        public void setData(VideoBean videoBean, int i) {
            if (videoBean.getVerticalImg() == null || videoBean.getVerticalImg().size() <= 0 || TextUtils.isEmpty(videoBean.getVerticalImg().get(0))) {
                GlideUtils.loadCropRadiusDefault(AdapterFifteen.this.fragment, 4, this.iv_cover);
            } else {
                Fragment fragment = AdapterFifteen.this.fragment;
                GlideUtils.loadCropRadiusWh2(fragment, AdapterFifteen.this.domain + videoBean.getVerticalImg().get(0), 4, this.iv_cover, 600);
            }
            this.tv_title.setText(videoBean.getTitle());
            TextView textView = this.tv_score;
            textView.setText(UiUtils.num2str(videoBean.getFakeWatchNum()) + "");
            this.tv_time.setText(TimeUtils.stringForTime(videoBean.getPlayTime() * 1000));
            this.iv_vip.setVisibility(8);
            this.iv_pay.setVisibility(8);
            if (videoBean.getVideoType() == 1) {
                this.iv_vip.setVisibility(0);
            } else if (videoBean.getVideoType() == 2) {
                this.iv_pay.setVisibility(0);
            }
            if (videoBean.getVideoType() == 0) {
                this.iv_xm.setVisibility(0);
            } else {
                this.iv_xm.setVisibility(8);
            }
            if (videoBean.isSelfMade()) {
                this.iv_original.setVisibility(0);
            } else {
                this.iv_original.setVisibility(8);
            }
        }
    }
}
